package com.veo.service.Imp;

import com.github.pagehelper.PageHelper;
import com.veo.dao.PermissionsDao;
import com.veo.domain.Permission;
import com.veo.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service("permissionService")
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private PermissionsDao permissionsDao;

    public List<Permission> findAllPermission(int page, int size, String searcherName) {
        //实现分页
        PageHelper.startPage(page,size);
        return permissionsDao.findAllPermission(searcherName);
    }

    public int addPermission(Permission permission) {
        return permissionsDao.addPermission(permission);
    }

    public int deleteRolePermissionId(String id) {
        return permissionsDao.deleteRolePermissionId(id);
    }

    public int deletePermissionById(String id) {
        return permissionsDao.deletePermissionById(id);
    }
}
